package kgame5.kutil
{
	import flash.utils.getTimer;

	/**
	 *直接用途是解决两次连续点击必须在制定时间间隔之内 
	 * @author Administrator
	 * 
	 */	
	public class GapTimer
	{
		private var lastMS:int;//上次点击的时间
		private var GAP:int;//间隔时间
		public function GapTimer(gap:int)
		{
			this.GAP=gap;
			reset();
		}
		public function reset():void{
			lastMS=-GAP;
		}
		public function test():Boolean{
			if(getTimer()-lastMS>GAP){
				lastMS=getTimer();
				return true;
			}
			return false;
		}
	}
}